#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: twl
@date: 2022/5/9 11:03
@description:
"""


# class Switcher(object):
#     def __init__(self):
#         self.done = True
#
#     def get_done(self):
#         return self.done
#
#     def set_done(self, done):
#         self.done = done
#
# switcher = Switcher()

TASK_SWITCHER = 'TASK_SWITCHER'

def init():#初始化
    global _global_dict
    _global_dict = {}
    set_value(TASK_SWITCHER, True)

def set_value(key,value):
    """ 定义一个全局变量 """
    _global_dict[key] = value

def get_value(key,defValue=None):
    try:
        return _global_dict[key]
    except KeyError:
        return defValue
